<!-- page heading start-->
<div class="page-heading ng-scope">
	<ul class="breadcrumb">
		<li><a href="#"> 首页 </a></li>
		<li><a href="#"> 参数管理 </a></li>
		<li class="active"> 角色管理</li>
	</ul>
</div>
<!-- page heading end-->
<div class="row">
    <div class="col-lg-12">
        <section class="panel">
            <header class="panel-heading"> 
           		<span ng-if="addOrEdit == true" > 编辑角色 </span>
            	<span ng-if="addOrEdit == false" > 添加角色 </span>
            </header>
            <div class="panel-body">
                <form class="form-horizontal" role="form" name="roleForm">
					<input type="text" ng-hide="true" ng-model="role.id" name="id">
                    <div class="form-group" ng-class="{'has-error':myForm.r_name.$dirty && myForm.r_name.$invalid}">
                        <label for="inputTypeName" class="col-lg-2 col-sm-2 control-label">角色名称</label>
                        <div class="col-lg-10">
                            <input type="text" class="form-control" id="inputTypeName" ng-model="role.r_name"
								name="r_name" ng-required="true"  ng-minlength="4" ng-maxlength="20" placeholder="请填写角色名称">
                            <label for="inputTypeName" 
                            ng-show="roleForm.r_name.$dirty && roleForm.r_name.$error.minlength" class="alert alert-danger help-block">* 长度不能小于4位</label>
                            <label for="inputTypeName" 
                            ng-show="roleForm.r_name.$dirty && roleForm.r_name.$error.maxlength" class="alert alert-danger help-block">* 长度不能超过20位</label>
                        </div>
                    </div>
                    
                    <div class="form-group" ng-class="{'has-error':myForm.r_value.$dirty && myForm.r_value.$invalid}">
                        <label for="inputTypeName" class="col-lg-2 col-sm-2 control-label">角色标识</label>
                        <div class="col-lg-10">
                            <input type="text" class="form-control" id="inputTypeName" ng-model="role.r_value" placeholder="请填写角色标识"
								name="r_value" ng-required="true"  ng-minlength="4" ng-maxlength="20">
                            <label for="inputTypeName" 
                            ng-show="roleForm.r_value.$dirty && roleForm.r_value.$error.minlength" class="alert alert-danger help-block">* 长度不能小于4位</label>
                            <label for="inputTypeName"  
                            ng-show="roleForm.r_value.$dirty && roleForm.r_value.$error.maxlength" class="alert alert-danger help-block">* 长度不能超过20位</label>
                        </div>
                    </div>
					
					<div class="form-group">
						<label class="col-lg-2 col-sm-2 control-label">是否系统默认</label>
                        <div class="col-lg-10">
							<label class="radio-inline" ng-init="context.r_is_system = 1"> 
								<input type="radio"  ng-model="role.r_is_system" name="r_is_system"  value="1" /> 是
							</label> 
							<label class="radio-inline"> 
								<input type="radio"  ng-model="role.r_is_system" name="r_is_system" ng-checked="true" value="0" /> 否
							</label>
						</div>
					</div>

					<div class="form-group">
						<label class="col-lg-2 col-sm-2 control-label">描述</label>
						<div class="col-lg-10">
							<textarea ck-editor class="form-control ckeditor" ng-model="role.r_description" name="r_description"
								ng-required="true" ng-maxlength="200"></textarea>
							<label for="inputKey" ng-show="roleForm.r_description.$dirty && roleForm.r_description.$error.maxlength" class="alert alert-danger help-block"
								> 最多能输入200字 </label>
						</div>
					</div>
					
                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-10">
							<button class="btn btn-danger" ng-disabled="roleForm.$invalid"
								ng-click="save()">保存</button>
							<button type="reset" class="btn btn-default" ng-click="back()">取消</button>
                        </div>
                    </div>
                </form>
            </div>
        </section>
    </div>
</div>